import request from '@/api/utils/request'
import { IPlansData } from '@/api/web_api/types'

export const defaultPlanData: IPlansData = {
  id: 0,
  title: '',
  description: '',
  type: '',
  tags: '',
  priority: 0,
  status: '',
  target: '',
  stime: 0,
  etime: 0
}

export const getPlans = (params: any) =>
  request({
    url: '/plan/search',
    method: 'get',
    params
  })

export const createPlan = (data: any) =>
  request({
    url: '/plan/create',
    method: 'post',
    data
  })

export const updatePlan = (data: any) =>
  request({
    url: '/plan/update',
    method: 'post',
    data
  })
